<template>
	<div>
		<el-table
		    :data="tableData"
		    style="width: 100%"
			height="500"
		    >
		    <el-table-column
		      prop="name"
		      label="项目名"
        >
		    </el-table-column>
		    <el-table-column
		      prop="createTime"
		      label="立项时间"
		      >
		    </el-table-column>
		    <el-table-column
		      prop="leader"
		      label="负责人"
		      >
		    </el-table-column>
		    <el-table-column
		      prop="state"
		      label="项目状态"
		      >
		    </el-table-column>
			<el-table-column
			      fixed="right"
			      label="操作"
			      >
			      <template slot-scope="scope">
			        <el-button type="text" size="small" @click="Info(scope.row.id)">查看详情</el-button>
<!--			        <el-button type="text" size="small" >开始捐赠流程</el-button>-->
			      </template>
			    </el-table-column>
		  </el-table>
	</div>
</template>

<script>
  import Convert from "../assets/js/Convert";
	export default {
		name:"allProjects",
		data() {
		  return {
			  tableData: [],
        pages : 1
		  }
		},
		methods:{
		    getInfo(){
            let _this = this
            this.$post({
                url : "project/admin/list",
                data : {
                    pages : _this.pages
                }
            }).then(res =>{
                res.records.forEach((item,index) =>{
                    item.state = Convert.ProjectState(item.state)
                    this.tableData.push(item)
                })


            })
        },
        Info(id){
            console.log(id)
            this.$router.push({
                path:"/project?project_id=" + id
            })
        }

		},
		components:{

		},
    mounted() {
        this.getInfo()
    }
  }
</script>

<style scoped>

</style>
